<?php


namespace App\Work;


use EasyWeChat\Work\Application;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\Request;

class AuthController extends BaseController
{



    public function redirect(){

        $config = [
            'corp_id' => 'ww1e76bb08a03c9d20',
            'secret'   => 'vj451u2zhcrRnpDsVnpg1L_ZwvopDFyuMi2p22bi_Wg', // 应用的 secret
        ];
        $app = new Application($config);
        // $callbackUrl 为授权回调地址
        $callbackUrl = Request::root(); // 需设置可信域名
        $redirectUrl = $app->getOAuth()->redirect($callbackUrl);
       return redirect($redirectUrl);
    }


}
